﻿<Window x:Class="LongBar.Library"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="LongBar Library" Height="500" Width="750" WindowStartupLocation="CenterScreen"
    Background="White" ShowActivated="True"
    Loaded="Window_Loaded" SizeChanged="Window_SizeChanged" ContentRendered="Window_ContentRendered">
    <Grid>
    <DockPanel Name="MainPanel" >
        <DockPanel DockPanel.Dock="Top">
            <Grid Background="White">
                <Rectangle VerticalAlignment="Top" Height="36" Stroke="#FFB1B1B1">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFAFCFD" Offset="0"/>
                            <GradientStop Color="#FFDCE7F6" Offset="1"/>
                            <GradientStop Color="#FFE6F0FA" Offset="0.5"/>
                            <GradientStop Color="#FFDCE6F4" Offset="0.5"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle Margin="0,36,0,0" VerticalAlignment="Top" Height="12" StrokeThickness="2">
                    <Rectangle.OpacityMask>
                        <LinearGradientBrush EndPoint="0,0" StartPoint="1,0">
                            <GradientStop Color="#FFFFFFFF" Offset="0.4"/>
                            <GradientStop Color="#FFFFFFFF" Offset="0.6"/>
                            <GradientStop Color="#77FFFFFF" Offset="0"/>
                            <GradientStop Color="#77000000" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.OpacityMask>
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#B29B9B9B" Offset="0"/>
                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <DockPanel>
                    <Grid Height="25" Width="240" DockPanel.Dock="Right" VerticalAlignment="Top" Margin="0,6,10,0">
                        <Grid.Triggers>
                            <EventTrigger RoutedEvent="Grid.Loaded">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)" From="-25" To="0" Duration="0:0:0.4" DecelerationRatio="0.3" Completed="DoubleAnimation_Completed_1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Grid.Triggers>
                        <Grid.RenderTransform>
                            <TranslateTransform/>
                        </Grid.RenderTransform>
                        <Rectangle RadiusX="2" RadiusY="2" Stroke="#7FFFFFFF"/>
                        <Rectangle Margin="1" RadiusX="1" RadiusY="2">
                            <Rectangle.Stroke>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF616467" Offset="0"/>
                                    <GradientStop Color="#999BA0A5" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>
                        <Rectangle Margin="2" Stroke="#FFFFFFFF"/>
                        <TextBox Margin="3" Name="SearchField" Text="Search tile..."  Opacity="0.7" FontStyle="Italic" Foreground="#FF696969" BorderThickness="0" VerticalContentAlignment="Center" IsKeyboardFocusedChanged="SearchField_IsKeyboardFocusedChanged" TextChanged="SearchField_TextChanged"/>
                        <Image Name="SearchIcon" Source="/LongBar;component/Resources/SearchIcon.png" Margin="0,0,5,0" HorizontalAlignment="Right" Width="15" Height="16"/>
                    </Grid>
                    <StackPanel Name="ToolBar" Orientation="Horizontal" VerticalAlignment="Top" Margin="5,5,0,0">
                        <!--<LB:ToolButton x:Name="DownloadButton" Visibility="Collapsed"/>-->
                    </StackPanel>
                </DockPanel>
            </Grid>
        </DockPanel>
        <Grid Name="BottomGrid" DockPanel.Dock="Bottom" Height="90" MinHeight="50" MaxHeight="200" >
            <Grid.Background>
                <LinearGradientBrush EndPoint="0,0" StartPoint="1,0">
                    <GradientStop Color="#FFDCF8FD" Offset="0"/>
                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>
            <Rectangle Name="BottomBorderRect"  VerticalAlignment="Top" Height="2" Cursor="SizeNS" MouseLeftButtonDown="BottomBorderRect_MouseLeftButtonDown" MouseLeftButtonUp="BottomBorderRect_MouseLeftButtonUp" MouseMove="BottomBorderRect_MouseMove">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFCCD9EA" Offset="0"/>
                        <GradientStop Color="#FFD9E3F0" Offset="1"/>
                        <GradientStop Color="#FFCCD9EA" Offset="0.5"/>
                        <GradientStop Color="#FFD9E3F0" Offset="0.5"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <DockPanel>
                <Image Name="CurrentItemIcon" DockPanel.Dock="Left" Margin="10" Source="/LongBar;component/Resources/Library_icon.png" />
                <TextBlock Name="ItemsCount" Text="Elements: 0" FontSize="13" Margin="0,10,0,0"/>
                <DockPanel Name="WrapPanel1" Margin="0,10,0,0" Visibility="Collapsed" Width="200">
                    <TextBlock DockPanel.Dock="Top"  Name="CurrentItemTitle" Text="Tile Title" FontSize="16"/>
                    <TextBlock Name="CurrentItemDescription" Text="Tile Description" FontSize="12" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" />
                </DockPanel>
                <WrapPanel Name="WrapPanel2" Orientation="Vertical" Margin="10" Visibility="Collapsed" >
                    <DockPanel Margin="0,0,10,0">
                        <TextBlock Text="Developer: " Foreground="Gray" FontSize="12"/>
                        <TextBlock Name="CurrentItemAuthor" Text="Stealth" FontSize="12"/>
                    </DockPanel >
                    <DockPanel Margin="0,0,10,0">
                        <TextBlock Text="Version: " Foreground="Gray" FontSize="12"/>
                        <TextBlock Name="CurrentItemVersion" Text="2.0.0.0" FontSize="12"/>
                    </DockPanel>
                </WrapPanel>
            </DockPanel>
        </Grid>                
        <StackPanel Name="Panel" Background="White">
            <!--<DockPanel Name="LongBarTiles" Margin="10,0,10,0">
                <DockPanel DockPanel.Dock="Top" Visibility="Collapsed">
                    <TextBlock Name="LongBarTilesCaption" DockPanel.Dock="Left" Text="LongBar Tiles (0)" Foreground="Gray"/>
                    <Line Margin="5,0,0,0" X1="0" X2="200" Stroke="Gray"  StrokeThickness="1" Stretch="UniformToFill" Opacity="0.7"/>
                </DockPanel>
                <WrapPanel Name="LongBarTilesPanel" Orientation="Horizontal"/>
            </DockPanel>-->
                    <DockPanel Name="DownTiles" Margin="10,0,0,0" Visibility="Visible">
                        <DockPanel DockPanel.Dock="Top">
                            <TextBlock Name="DownTilesCaption" DockPanel.Dock="Left" Text="Downloadable Tiles (0)" Foreground="Gray"/>
                            <Line Margin="5,0,10,0" X1="0" X2="200" Stroke="Gray"  StrokeThickness="1" Stretch="UniformToFill" Opacity="0.7"/>
                        </DockPanel>
                    <Grid Background="White">
                        <Image Source="/LongBar;component/Resources/LongBar 2.0 Logo.png" Height="150" Margin="0,0,15,0" Opacity="0.2" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
                        <ScrollViewer Name="DownTilesPanelScrollViewer" VerticalScrollBarVisibility="Auto" PreviewMouseLeftButtonDown="DownTilesPanel_PreviewMouseLeftButtonDown">
                                <WrapPanel Name="DownTilesPanel" Orientation="Horizontal"/>
                        </ScrollViewer>
                    </Grid>
                    </DockPanel>
                    <DockPanel Name="SearchTiles" Margin="10,0,10,0" Visibility="Collapsed">
                        <DockPanel DockPanel.Dock="Top">
                            <TextBlock Name="SearchTilesCaption" DockPanel.Dock="Left" Text="Found: 0" Foreground="Gray"/>
                            <Line Margin="5,0,0,0" X1="0" X2="200" Stroke="Gray"  StrokeThickness="1" Stretch="UniformToFill" Opacity="0.7"/>
                        </DockPanel>
                        <WrapPanel Name="SearchTilesPanel" Orientation="Horizontal"/>
                    </DockPanel>
                </StackPanel>
        </DockPanel>
        <Grid Name="LoadingGrid" Opacity="0" Visibility="Collapsed">
            <Grid.Resources>
                <DoubleAnimation x:Key="OpacityAnim1" To="1" Duration="0:0:0.3" Completed="DoubleAnimation_Completed"/>
                <DoubleAnimation x:Key="OpacityAnim2" To="0" Duration="0:0:0.3"/>
            </Grid.Resources>
            <Rectangle Fill="Black" Opacity="0.4"/>
            <Grid Width="450" Height="80" VerticalAlignment="Center">
                <Rectangle RadiusX="5" RadiusY="5" Stroke="White" Fill="Gray"/>
                <Rectangle Margin="2" RadiusX="5" RadiusY="5">
                    <Rectangle.Fill>
                        <LinearGradientBrush StartPoint="1,0" EndPoint="1,1">
                            <GradientStop Color="#FFFDFEFF" Offset="0.0" />
                            <GradientStop Color="#FFEDF2FA" Offset="0.4" />
                            <GradientStop Color="#FFC1D2E8" Offset="1" />
                            <GradientStop Color="#FFD7E4F4" Offset="0.6"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <StackPanel Width="400" VerticalAlignment="Center">
                    <TextBlock Name="DownloadingStatusTextBlock" Text="Connecting..." TextAlignment="Center"/>
                    <Grid>
                        <ProgressBar Name="ProgressBar" Height="20"/>
                        <TextBlock Name="DownloadingProgressTextBlock" Text="0 Kb from 0 Kb" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    </Grid>
                    <Button Name="CancelDownloadButton" Content="Cancel" Width="80" Margin="0,5,0,0" HorizontalAlignment="Right" Click="CancelDownloadButton_Click"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</Window>
